import { createStore, combineReducers } from 'redux'
import { num } from './reducer/num'
import { count } from './reducer/count'

// combineReducers 合并reducer

let reducer = combineReducers({
    num,
    count
})

let store = createStore(reducer)
window.store = store

export default store




// let reducer = (state, action) => {
//     return {
//         num: num(state.num, action),
//         count: count(state.count, action)
//     }
// }

// let initState = {
//     num: 100,
//     count: 888
// }

// let store = createStore(reducer, initState)

// window.store = store

// export default store